<?php
	/**
	 * Follower request plugin
	 * Extend the Elgg topbar with link to follower notifications, if any
	 * 
	 * @author Mark Kelly
	 */

	if($user = get_loggedin_user()){
		
		$options = array(
			"type" => "user",
			"relationship" => "new_follower",
			"relationship_guid" => $user->getGUID(),
			"inverse_relationship" => true,
			"count" => true
		);
		
		if($count = elgg_get_entities_from_relationship($options)){
			echo "<a href='" . $CONFIG->wwwroot . "pg/followers' class='new_follower' title='" . elgg_echo('follower:new') . "'>[" . $count . "]</a>";
		}
	}
?>